// 车辆管理相关接口
import { createAPI } from '@/utils/request'

// 获取车辆分页数据
export const getTrunkListPageAPI = data => createAPI('truck/page', 'get', data)

// 统计车辆
export const statsTrunkAPI = data => createAPI(`/count`, 'get')

// 新增车辆
export const addTrunkAPI = data => createAPI(`/truck`, 'post', data)

// 获取车辆详情
export const getTrunkDetailAPI = id => createAPI(`/truck/${id}`, 'get')

// 更新车辆详情
export const updateTrunkDetailAPI = data => createAPI(`/truck/${data.id}`, 'put', data)

// 获取行驶证详情
export const getLicenseDetailAPI = id => createAPI(`/truck/${id}/license`, 'get')

// 更新行驶证详情
export const updateLicenseDetailAPI = ({ id, data }) => createAPI(`/truck/${id}
/license`, 'post', data)

// 启用车辆
export const startCarAPI = id => createAPI(`/enable/${id}`, 'put')

// 停用车辆
export const deactivatedCarAPI = id => createAPI(`/disable/${id}`, 'put')

// 获取未绑定车辆的司机
export const getDriverAPI = data => createAPI(`/unBindingDrivers/`, 'get')

// 给车辆配置司机
export const setDriverAPI = data => createAPI('/truck/truckDrivers', 'post', data)
